import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    // 视频
    path: '/video',
    name: 'video',
    component: () => import('../views/VideoView.vue')
  },
  {
    // 小视频
    path: '/smallvideo',
    name: 'smallvideo',
    component: () => import('../views/SmallVideo.vue')
  },
  {
    // 小视频
    path: '/myinfo',
    name: 'myinfo',
    component: () => import('../views/MyInfo.vue'),
    meta: {
      hideNav: true
    }
  },

  {
    // 电影详情 通过动态路由传入id
    path: '/details/:movieid',
    name: 'details',
    props: true,
    component: () => import('../views/FilmDetails.vue'),
    meta: {
      tabNav: true
    }
  },
  {
    // 电影院列表 通过动态路由传入id
    path: '/cinema/:cinemaId',
    name: 'cinema',

    props: true,
    component: () => import('../views/CinemaDetails.vue'),
    meta: {//隐藏导航条
      hideNav: true
    }
  },
  {
    // 电影院列表 通过动态路由传入id
    path: '/seat/:cinemaId',
    name: 'seat',

    props: true,
    component: () => import('../views/SeatView.vue'),
    meta: {//隐藏导航条
      hideNav: true
    }
  },

]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
